package com.example.springbootredis;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

@Component
//实现InitializingBean, DisposableBean 接口
public class Cat implements InitializingBean, DisposableBean {
    //初始化
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("--------afterPropertiesSet one--------");
    }
    //销毁
    @Override
    public void destroy() throws Exception {
        System.out.println("--------destroy one--------");
    }
}